<div class="timesheets index">
        <h2><?php __($this->params['pass']['0'] . ' Timesheets'); ?></h2><br/>
        <table cellpadding="0" cellspacing="0">
            <tr>
                <th class="title"><?php echo $this->Paginator->sort('client_id'); ?></th>
                <th class="title"><?php echo $this->Paginator->sort('user_id'); ?></th>
                <th class="title"><?php echo $this->Paginator->sort('date'); ?></th>
                <th class="title"><?php echo $this->Paginator->sort('Customer', 'customer name'); ?></th>
                <th class="title"><?php echo $this->Paginator->sort('type'); ?></th>
                <th class="title"><?php echo $this->Paginator->sort('location'); ?></th>
                <th class="title"><?php echo $this->Paginator->sort('Start', 'start time'); ?></th>
                <th class="title"><?php echo $this->Paginator->sort('Finish', 'finish time'); ?></th>
                <th class="title"><?php echo $this->Paginator->sort('Services', 'services provided'); ?></th>
                <th class="title"><?php echo $this->Paginator->sort('Resources', 'hardware and software'); ?></th>
                <th class="actions"><?php __('Actions'); ?></th>
            </tr>
            <?php
            if (!empty($timesheets)):
                $i = 0;
                foreach ($timesheets as $timesheet):
                    $class = null;
                    if ($i++ % 2 == 0) {
                        $class = ' class="altrow"';
                    }
                    ?>
                    <tr<?php echo $class; ?>>
                        <td>
                            <?php echo $this->Html->link($timesheet['Client']['name'], array('controller' => 'clients', 'action' => 'view', $timesheet['Client']['id'])); ?>
                        </td>
                        <td>
                            <?php echo $this->Html->link($timesheet['User']['username'], array('controller' => 'users', 'action' => 'view', $timesheet['User']['id'])); ?>
                        </td>
                        <td><?php echo $timesheet['Timesheet']['date']; ?>&nbsp;</td>
                        <td><?php echo $timesheet['Timesheet']['customer name']; ?>&nbsp;</td>
                        <td><?php echo $timesheet['Timesheet']['type']; ?>&nbsp;</td>
                        <td><?php echo $timesheet['Timesheet']['location']; ?>&nbsp;</td>
                        <td><?php echo $timesheet['Timesheet']['start time']; ?>&nbsp;</td>
                        <td><?php echo $timesheet['Timesheet']['finish time']; ?>&nbsp;</td>
                        <td><?php echo $timesheet['Timesheet']['services provided']; ?>&nbsp;</td>
                        <td><?php echo $timesheet['Timesheet']['hardware and software']; ?>&nbsp;</td>
                        <td class="actions">
                            <?php echo $this->Html->link(__('View', true), array('action' => 'view', $timesheet['Timesheet']['id'])); ?>
                            <?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $timesheet['Timesheet']['id'])); ?>
                            <?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $timesheet['Timesheet']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $timesheet['Timesheet']['id'])); ?>
                        </td>
                    </tr>
                <?php endforeach; ?>
            </table>
           <div class="right"><?php echo $this->Html->link('Back to All Timesheets', array('controller' => 'timesheets', 'action' => 'index'));?></div>
            <?php
            echo '<center>';
            echo $paginator->prev('<< Previous', null, null, array('class' => 'disabled'));
            echo '&nbsp;&nbsp;';
            echo $paginator->numbers();
            echo '&nbsp;&nbsp;';
            echo $paginator->next('Next >>', null, null, array('class' => 'disabled'));
            echo '<br /><br />';
            echo $paginator->counter(array('format' => 'Page %page% of %pages%, showing %current% records out of %count% total.'));
            echo '</center><br /><br />';
            ?>			
            <?php
        else:
            if ($this->params['pass']['0'] == 'Active'):
                echo '<center>No Active Projects</center><br /><br />';
            endif;
            if ($this->params['pass']['0'] == 'Inactive'):
                echo '<center>No Inactive Projects</center><br /><br />';
            endif;
            if ($this->params['pass']['0'] == 'Completed'):
                echo '<center>No Completed Projects</center><br /><br />';
            endif;
            echo '<center>';
            $back = $this->webroot . 'timesheets/index';
            echo $form->button('Back to timesheets', array('onclick' => "location.href='" . $back . "'"));
            echo '</center>';
        endif;
        ?>		
</div>
